package au.edu.swin.videoshop.bean;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ReservationStatus implements Serializable {
	private static final Map sMap = new HashMap();
	
	public static final ReservationStatus OPEN = new ReservationStatus("Open", "Open");
	public static final ReservationStatus FULFILLED = new ReservationStatus("Fulfilled", "Fulfilled");
	public static final ReservationStatus CANCELLED = new ReservationStatus("Cancelled", "Cancelled");
	public static final ReservationStatus EXPIRED = new ReservationStatus("Expired", "Expired");
	
	private String mName;
	private String mDescription;
	
	private ReservationStatus(String name, String description) {
		mName = name;
		mDescription = description;
		
		sMap.put(name, this);
	}
	
	/**
	 * @return the name
	 */
	public String getName() {
		return mName;
	}
	
	/**
	 * @return the description
	 */
	public String getDescription() {
		return mDescription;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return mName;
	}
	
	public static ReservationStatus getInstance(String name) {
		return (ReservationStatus)sMap.get(name);
	}
}